﻿using ContactSMS.Commons.Util;

namespace ContactSMS.Domain.Entity
{
    public class User
    {
        public long Id { get; set; }
        public string UserName { get; set; }
        public string? Avatar { get; set; }
        public string Phone { get; set; }
        public string Email { get; set; }
        public string PassWord { get; set; }
        public long CreatTime { get; set; }
        public long UpdateTime { get; set; }

        public User()
        {

        }

        public User(string UserName, string PassWord, string avatar, string email, string phone)
        {
            this.UserName = UserName;
            this.PassWord = PassWordUtil.HashPassword(PassWord);
            this.Avatar = avatar;
            this.CreatTime = TimeUtil.GetTimestamp();
            this.UpdateTime = TimeUtil.GetTimestamp();
            this.Email = email;
            this.Phone = phone;
        }
    }
}
